home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1999 July: Mac OS SDK / Dev.CD Jul 99 SDK1.toast / Development Kits / Mac OS / Interfaces&Libraries / Universal / Interfaces / CIncludes / MIDI.h < prev    next >
Encoding:
C/C++ Source or Header  |  1998-08-17  |  18.9 KB  |  527 lines  |  [TEXT/MPS ]

  1. /*
  2.      File:        MIDI.h
  3.  
  4.      Contains:    MIDI Manager Interfaces.
  5.  
  6.      Version:    Technology:    System 7.5
  7.                  Release:    Universal Interfaces 3.2
  8.  
  9.      Copyright:    © 1988-1998 by Apple Computer, Inc., all rights reserved
  10.  
  11.      Bugs?:        For bug reports, consult the following page on
  12.                  the World Wide Web:
  13.  
  14.                      http://developer.apple.com/bugreporter/
  15.  
  16. */
  17. #ifndef __MIDI__
  18. #define __MIDI__
  19.  
  20. #ifndef __ERRORS__
  21. #include <Errors.h>
  22. #endif
  23. #ifndef __MACTYPES__
  24. #include <MacTypes.h>
  25. #endif
  26. #ifndef __MIXEDMODE__
  27. #include <MixedMode.h>
  28. #endif
  29.  
  30.  
  31.  
  32. #if PRAGMA_ONCE
  33. #pragma once
  34. #endif
  35.  
  36. #ifdef __cplusplus
  37. extern "C" {
  38. #endif
  39.  
  40. #if PRAGMA_IMPORT
  41. #pragma import on
  42. #endif
  43.  
  44. #if PRAGMA_STRUCT_ALIGN
  45.     #pragma options align=mac68k
  46. #elif PRAGMA_STRUCT_PACKPUSH
  47.     #pragma pack(push, 2)
  48. #elif PRAGMA_STRUCT_PACK
  49.     #pragma pack(2)
  50. #endif
  51.  
  52. /*
  53.                         * * *  N O T E  * * * 
  54.  
  55.     This file has been updated to include MIDI 2.0 interfaces.  
  56.     
  57.     The MIDI 2.0 interfaces were developed for the classic 68K runtime.
  58.     Since then, Apple has created the PowerPC and CFM 68K runtimes.
  59.     Currently, the extra functions in MIDI 2.0 are not in InterfaceLib
  60.     and thus not callable from PowerPC and CFM 68K runtimes (you'll
  61.     get a linker error).  
  62. */
  63.  
  64.  
  65. enum {
  66.     midiMaxNameLen                = 31                            /*maximum number of characters in port and client names*/
  67. };
  68.  
  69.  
  70. enum {
  71.                                                                 /* Time formats */
  72.     midiFormatMSec                = 0,                            /*milliseconds*/
  73.     midiFormatBeats                = 1,                            /*beats*/
  74.     midiFormat24fpsBit            = 2,                            /*24 frames/sec.*/
  75.     midiFormat25fpsBit            = 3,                            /*25 frames/sec.*/
  76.     midiFormat30fpsDBit            = 4,                            /*30 frames/sec. drop-frame*/
  77.     midiFormat30fpsBit            = 5,                            /*30 frames/sec.*/
  78.     midiFormat24fpsQF            = 6,                            /*24 frames/sec. longInt format */
  79.     midiFormat25fpsQF            = 7,                            /*25 frames/sec. longInt format */
  80.     midiFormat30fpsDQF            = 8,                            /*30 frames/sec. drop-frame longInt format */
  81.     midiFormat30fpsQF            = 9                                /*30 frames/sec. longInt format */
  82. };
  83.  
  84.  
  85. enum {
  86.     midiInternalSync            = 0,                            /*internal sync*/
  87.     midiExternalSync            = 1                                /*external sync*/
  88. };
  89.  
  90.  
  91. enum {
  92.                                                                 /* Port types*/
  93.     midiPortTypeTime            = 0,                            /*time port*/
  94.     midiPortTypeInput            = 1,                            /*input port*/
  95.     midiPortTypeOutput            = 2,                            /*output port*/
  96.     midiPortTypeTimeInv            = 3,                            /*invisible time port*/
  97.     midiPortInvisible            = 0x8000,                        /*logical OR this to other types to make invisible ports*/
  98.     midiPortTypeMask            = 0x0007                        /*logical AND with this to convert new port types to old, i.e. to strip the property bits*/
  99. };
  100.  
  101.  
  102. enum {
  103.                                                                 /* OffsetTimes  */
  104.     midiGetEverything            = 0x7FFFFFFF,                    /*get all packets, regardless of time stamps*/
  105.     midiGetNothing                = (long)0x80000000,                /*get no packets, regardless of time stamps*/
  106.     midiGetCurrent                = 0x00000000                    /*get current packets only*/
  107. };
  108.  
  109. /*    MIDI data and messages are passed in MIDIPacket records (see below).
  110.     The first byte of every MIDIPacket contains a set of flags
  111.  
  112.     bits 0-1    00 = new MIDIPacket, not continued
  113.                      01 = begining of continued MIDIPacket
  114.                      10 = end of continued MIDIPacket
  115.                      11 = continuation
  116.     bits 2-3     reserved
  117.  
  118.     bits 4-6      000 = packet contains MIDI data
  119.  
  120.                   001 = packet contains MIDI Manager message
  121.  
  122.     bit 7         0 = MIDIPacket has valid stamp
  123.                   1 = stamp with current clock
  124. */
  125.  
  126. enum {
  127.     midiContMask                = 0x03,
  128.     midiNoCont                    = 0x00,
  129.     midiStartCont                = 0x01,
  130.     midiMidCont                    = 0x03,
  131.     midiEndCont                    = 0x02,
  132.     midiTypeMask                = 0x70,
  133.     midiMsgType                    = 0x00,
  134.     midiMgrType                    = 0x10,
  135.     midiTimeStampMask            = 0x80,
  136.     midiTimeStampCurrent        = 0x80,
  137.     midiTimeStampValid            = 0x00
  138. };
  139.  
  140.  
  141. enum {
  142.                                                                 /* MIDIPacket command words (the first word in the data field for midiMgrType messages) */
  143.     midiOverflowErr                = 0x0001,
  144.     midiSCCErr                    = 0x0002,
  145.     midiPacketErr                = 0x0003,                        /*all command words less than this value are error indicators*/
  146.     midiMaxErr                    = 0x00FF
  147. };
  148.  
  149.  
  150. enum {
  151.                                                                 /* Valid results to be returned by readHooks */
  152.     midiKeepPacket                = 0,
  153.     midiMorePacket                = 1,
  154.     midiNoMorePacket            = 2,
  155.     midiHoldPacket                = 3
  156. };
  157.  
  158.  
  159. enum {
  160.                                                                 /* Driver calls */
  161.     midiOpenDriver                = 1,
  162.     midiCloseDriver                = 2
  163. };
  164.  
  165.  
  166. enum {
  167.     mdvrAbortNotesOff            = 0,                            /*abort previous mdvrNotesOff request*/
  168.     mdvrChanNotesOff            = 1,                            /*generate channel note off messages*/
  169.     mdvrAllNotesOff                = 2                                /*generate all note off messages*/
  170. };
  171.  
  172.  
  173. enum {
  174.     mdvrStopOut                    = 0,                            /*stop calling MDVROut temporarily*/
  175.     mdvrStartOut                = 1                                /*resume calling MDVROut*/
  176. };
  177.  
  178.  
  179. struct MIDIPacket {
  180.     UInt8                             flags;
  181.     UInt8                             len;
  182.     long                             tStamp;
  183.     UInt8                             data[249];
  184. };
  185. typedef struct MIDIPacket                MIDIPacket;
  186. typedef MIDIPacket *                    MIDIPacketPtr;
  187. typedef CALLBACK_API( short , MIDIReadHookProcPtr )(MIDIPacketPtr myPacket, long myRefCon);
  188. typedef CALLBACK_API( void , MIDITimeProcPtr )(long curTime, long myRefCon);
  189. typedef CALLBACK_API( void , MIDIConnectionProcPtr )(short refnum, long refcon, short portType, OSType clientID, OSType portID, Boolean connect, short direction);
  190. typedef CALLBACK_API( long , MDVRCommProcPtr )(short refnum, short request, long refCon);
  191. typedef CALLBACK_API( void , MDVRTimeCodeProcPtr )(short refnum, short newFormat, long refCon);
  192. typedef CALLBACK_API( void , MDVRReadProcPtr )(char *midiChars, short length, long refCon);
  193. typedef STACK_UPP_TYPE(MIDIReadHookProcPtr)                     MIDIReadHookUPP;
  194. typedef STACK_UPP_TYPE(MIDITimeProcPtr)                         MIDITimeUPP;
  195. typedef STACK_UPP_TYPE(MIDIConnectionProcPtr)                     MIDIConnectionUPP;
  196. typedef STACK_UPP_TYPE(MDVRCommProcPtr)                         MDVRCommUPP;
  197. typedef STACK_UPP_TYPE(MDVRTimeCodeProcPtr)                     MDVRTimeCodeUPP;
  198. typedef STACK_UPP_TYPE(MDVRReadProcPtr)                         MDVRReadUPP;
  199.  
  200. struct MIDIClkInfo {
  201.     short                             syncType;                    /*synchronization external/internal*/
  202.     long                             curTime;                    /*current value of port's clock*/
  203.     short                             format;                        /*time code format*/
  204. };
  205. typedef struct MIDIClkInfo                MIDIClkInfo;
  206.  
  207. struct MIDIIDRec {
  208.     OSType                             clientID;
  209.     OSType                             portID;
  210. };
  211. typedef struct MIDIIDRec                MIDIIDRec;
  212.  
  213. struct MIDIPortInfo {
  214.     short                             portType;                    /*type of port*/
  215.     MIDIIDRec                         timeBase;                    /*MIDIIDRec for time base*/
  216.     short                             numConnects;                /*number of connections*/
  217.     MIDIIDRec                         cList[1];                    /*ARRAY [1..numConnects] of MIDIIDRec*/
  218. };
  219. typedef struct MIDIPortInfo                MIDIPortInfo;
  220. typedef MIDIPortInfo *                    MIDIPortInfoPtr;
  221. typedef MIDIPortInfoPtr *                MIDIPortInfoHdl;
  222. typedef MIDIPortInfoPtr *                MIDIPortInfoHandle;
  223.  
  224. struct MIDIPortParams {
  225.     OSType                             portID;                        /*ID of port, unique within client*/
  226.     short                             portType;                    /*Type of port - input, output, time, etc.*/
  227.     short                             timeBase;                    /*refnum of time base, 0 if none*/
  228.     long                             offsetTime;                    /*offset for current time stamps*/
  229.     MIDIReadHookUPP                 readHook;                    /*routine to call when input data is valid*/
  230.     long                             refCon;                        /*refcon for port (for client use)*/
  231.     MIDIClkInfo                     initClock;                    /*initial settings for a time base*/
  232.     Str255                             name;                        /*name of the port, This is a real live string, not a ptr.*/
  233. };
  234. typedef struct MIDIPortParams            MIDIPortParams;
  235. typedef MIDIPortParams *                MIDIPortParamsPtr;
  236.  
  237. struct MIDIIDList {
  238.     short                             numIDs;
  239.     OSType                             list[1];
  240. };
  241. typedef struct MIDIIDList                MIDIIDList;
  242. typedef MIDIIDList *                    MIDIIDListPtr;
  243. typedef MIDIIDListPtr *                    MIDIIDListHdl;
  244. typedef MIDIIDListPtr *                    MIDIIDListHandle;
  245. /* MDVR Control structs*/
  246.  
  247. struct MDVRInCtlRec {
  248.     short                             timeCodeClock;                /*refnum of time base for time code*/
  249.     short                             timeCodeFormat;                /*format of time code output*/
  250.     MDVRReadUPP                     readProc;                    /*proc to call with intput characters*/
  251.     MDVRCommUPP                     commProc;                    /*proc to call for handshaking*/
  252.     long                             refCon;                        /*refCon passed to readProc, commProc*/
  253. };
  254. typedef struct MDVRInCtlRec                MDVRInCtlRec;
  255.  
  256. typedef MDVRInCtlRec *                    MDVRInCtlPtr;
  257.  
  258. struct MDVROutCtlRec {
  259.     short                             timeCodeClock;                /*time base driven by time code*/
  260.     short                             timeCodeFormat;                /*format of time code to listen to*/
  261.     MDVRTimeCodeUPP                 timeCodeProc;                /*proc called on time code fmt change*/
  262.     MDVRCommUPP                     commProc;                    /*proc called for handshaking*/
  263.     long                             refCon;                        /*refCon passed to timeCodeProc*/
  264.     Boolean                         timeCodeFilter;                /*filter time code if true*/
  265.     UInt8                             padding;                    /*unused pad byte*/
  266.     long                             midiMsgTicks;                /*value of Ticks when MIDI msg rcvd*/
  267.     long                             timeCodeTicks;                /*value of Ticks when time code rcvd*/
  268. };
  269. typedef struct MDVROutCtlRec            MDVROutCtlRec;
  270.  
  271. typedef MDVROutCtlRec *                    MDVROutCtlPtr;
  272. typedef void *                            MDVRPtr;
  273. EXTERN_API( NumVersion )
  274. MIDIVersion                        (void)                                                        FOURWORDINLINE(0x203C, 0x0000, 0x0004, 0xA800);
  275.  
  276. EXTERN_API( OSErr )
  277. MIDISignIn                        (OSType                 clientID,
  278.                                  long                     refCon,
  279.                                  Handle                 icon,
  280.                                  ConstStr255Param         name)                                FOURWORDINLINE(0x203C, 0x0004, 0x0004, 0xA800);
  281.  
  282. EXTERN_API( void )
  283. MIDISignOut                        (OSType                 clientID)                            FOURWORDINLINE(0x203C, 0x0008, 0x0004, 0xA800);
  284.  
  285. EXTERN_API( MIDIIDListHandle )
  286. MIDIGetClients                    (void)                                                        FOURWORDINLINE(0x203C, 0x000C, 0x0004, 0xA800);
  287.  
  288. EXTERN_API( void )
  289. MIDIGetClientName                (OSType                 clientID,
  290.                                  Str255                 name)                                FOURWORDINLINE(0x203C, 0x0010, 0x0004, 0xA800);
  291.  
  292. EXTERN_API( void )
  293. MIDISetClientName                (OSType                 clientID,
  294.                                  ConstStr255Param         name)                                FOURWORDINLINE(0x203C, 0x0014, 0x0004, 0xA800);
  295.  
  296. EXTERN_API( MIDIIDListHandle )
  297. MIDIGetPorts                    (OSType                 clientID)                            FOURWORDINLINE(0x203C, 0x0018, 0x0004, 0xA800);
  298.  
  299. EXTERN_API( OSErr )
  300. MIDIAddPort                        (OSType                 clientID,
  301.                                  short                     BufSize,
  302.                                  short *                refnum,
  303.                                  MIDIPortParamsPtr         init)                                FOURWORDINLINE(0x203C, 0x001C, 0x0004, 0xA800);
  304.  
  305. EXTERN_API( MIDIPortInfoHandle )
  306. MIDIGetPortInfo                    (OSType                 clientID,
  307.                                  OSType                 portID)                                FOURWORDINLINE(0x203C, 0x0020, 0x0004, 0xA800);
  308.  
  309. EXTERN_API( OSErr )
  310. MIDIConnectData                    (OSType                 srcClID,
  311.                                  OSType                 srcPortID,
  312.                                  OSType                 dstClID,
  313.                                  OSType                 dstPortID)                            FOURWORDINLINE(0x203C, 0x0024, 0x0004, 0xA800);
  314.  
  315. EXTERN_API( OSErr )
  316. MIDIUnConnectData                (OSType                 srcClID,
  317.                                  OSType                 srcPortID,
  318.                                  OSType                 dstClID,
  319.                                  OSType                 dstPortID)                            FOURWORDINLINE(0x203C, 0x0028, 0x0004, 0xA800);
  320.  
  321. EXTERN_API( OSErr )
  322. MIDIConnectTime                    (OSType                 srcClID,
  323.                                  OSType                 srcPortID,
  324.                                  OSType                 dstClID,
  325.                                  OSType                 dstPortID)                            FOURWORDINLINE(0x203C, 0x002C, 0x0004, 0xA800);
  326.  
  327. EXTERN_API( OSErr )
  328. MIDIUnConnectTime                (OSType                 srcClID,
  329.                                  OSType                 srcPortID,
  330.                                  OSType                 dstClID,
  331.                                  OSType                 dstPortID)                            FOURWORDINLINE(0x203C, 0x0030, 0x0004, 0xA800);
  332.  
  333. EXTERN_API( void )
  334. MIDIFlush                        (short                     refnum)                                FOURWORDINLINE(0x203C, 0x0034, 0x0004, 0xA800);
  335.  
  336. EXTERN_API( ProcPtr )
  337. MIDIGetReadHook                    (short                     refnum)                                FOURWORDINLINE(0x203C, 0x0038, 0x0004, 0xA800);
  338.  
  339. EXTERN_API( void )
  340. MIDISetReadHook                    (short                     refnum,
  341.                                  ProcPtr                 hook)                                FOURWORDINLINE(0x203C, 0x003C, 0x0004, 0xA800);
  342.  
  343. EXTERN_API( void )
  344. MIDIGetPortName                    (OSType                 clientID,
  345.                                  OSType                 portID,
  346.                                  Str255                 name)                                FOURWORDINLINE(0x203C, 0x0040, 0x0004, 0xA800);
  347.  
  348. EXTERN_API( void )
  349. MIDISetPortName                    (OSType                 clientID,
  350.                                  OSType                 portID,
  351.                                  ConstStr255Param         name)                                FOURWORDINLINE(0x203C, 0x0044, 0x0004, 0xA800);
  352.  
  353. EXTERN_API( void )
  354. MIDIWakeUp                        (short                     refnum,
  355.                                  long                     time,
  356.                                  long                     period,
  357.                                  MIDITimeUPP             timeProc)                            FOURWORDINLINE(0x203C, 0x0048, 0x0004, 0xA800);
  358.  
  359. EXTERN_API( void )
  360. MIDIRemovePort                    (short                     refnum)                                FOURWORDINLINE(0x203C, 0x004C, 0x0004, 0xA800);
  361.  
  362. EXTERN_API( short )
  363. MIDIGetSync                        (short                     refnum)                                FOURWORDINLINE(0x203C, 0x0050, 0x0004, 0xA800);
  364.  
  365. EXTERN_API( void )
  366. MIDISetSync                        (short                     refnum,
  367.                                  short                     sync)                                FOURWORDINLINE(0x203C, 0x0054, 0x0004, 0xA800);
  368.  
  369. EXTERN_API( long )
  370. MIDIGetCurTime                    (short                     refnum)                                FOURWORDINLINE(0x203C, 0x0058, 0x0004, 0xA800);
  371.  
  372. EXTERN_API( void )
  373. MIDISetCurTime                    (short                     refnum,
  374.                                  long                     time)                                FOURWORDINLINE(0x203C, 0x005C, 0x0004, 0xA800);
  375.  
  376. EXTERN_API( void )
  377. MIDIStartTime                    (short                     refnum)                                FOURWORDINLINE(0x203C, 0x0060, 0x0004, 0xA800);
  378.  
  379. EXTERN_API( void )
  380. MIDIStopTime                    (short                     refnum)                                FOURWORDINLINE(0x203C, 0x0064, 0x0004, 0xA800);
  381.  
  382. EXTERN_API( void )
  383. MIDIPoll                        (short                     refnum,
  384.                                  long                     offsetTime)                            FOURWORDINLINE(0x203C, 0x0068, 0x0004, 0xA800);
  385.  
  386. EXTERN_API( OSErr )
  387. MIDIWritePacket                    (short                     refnum,
  388.                                  MIDIPacketPtr             packet)                                FOURWORDINLINE(0x203C, 0x006C, 0x0004, 0xA800);
  389.  
  390. EXTERN_API( Boolean )
  391. MIDIWorldChanged                (OSType                 clientID)                            FOURWORDINLINE(0x203C, 0x0070, 0x0004, 0xA800);
  392.  
  393. EXTERN_API( long )
  394. MIDIGetOffsetTime                (short                     refnum)                                FOURWORDINLINE(0x203C, 0x0074, 0x0004, 0xA800);
  395.  
  396. EXTERN_API( void )
  397. MIDISetOffsetTime                (short                     refnum,
  398.                                  long                     offsetTime)                            FOURWORDINLINE(0x203C, 0x0078, 0x0004, 0xA800);
  399.  
  400. EXTERN_API( long )
  401. MIDIConvertTime                    (short                     srcFormat,
  402.                                  short                     dstFormat,
  403.                                  long                     time)                                FOURWORDINLINE(0x203C, 0x007C, 0x0004, 0xA800);
  404.  
  405. EXTERN_API( long )
  406. MIDIGetRefCon                    (short                     refnum)                                FOURWORDINLINE(0x203C, 0x0080, 0x0004, 0xA800);
  407.  
  408. EXTERN_API( void )
  409. MIDISetRefCon                    (short                     refnum,
  410.                                  long                     refCon)                                FOURWORDINLINE(0x203C, 0x0084, 0x0004, 0xA800);
  411.  
  412. EXTERN_API( long )
  413. MIDIGetClRefCon                    (OSType                 clientID)                            FOURWORDINLINE(0x203C, 0x0088, 0x0004, 0xA800);
  414.  
  415. EXTERN_API( void )
  416. MIDISetClRefCon                    (OSType                 clientID,
  417.                                  long                     refCon)                                FOURWORDINLINE(0x203C, 0x008C, 0x0004, 0xA800);
  418.  
  419. EXTERN_API( short )
  420. MIDIGetTCFormat                    (short                     refnum)                                FOURWORDINLINE(0x203C, 0x0090, 0x0004, 0xA800);
  421.  
  422. EXTERN_API( void )
  423. MIDISetTCFormat                    (short                     refnum,
  424.                                  short                     format)                                FOURWORDINLINE(0x203C, 0x0094, 0x0004, 0xA800);
  425.  
  426. EXTERN_API( void )
  427. MIDISetRunRate                    (short                     refnum,
  428.                                  short                     rate,
  429.                                  long                     time)                                FOURWORDINLINE(0x203C, 0x0098, 0x0004, 0xA800);
  430.  
  431. EXTERN_API( Handle )
  432. MIDIGetClientIcon                (OSType                 clientID)                            FOURWORDINLINE(0x203C, 0x009C, 0x0004, 0xA800);
  433.  
  434. EXTERN_API( ProcPtr )
  435. MIDICallAddress                    (short                     callNum)                            FOURWORDINLINE(0x203C, 0x00A4, 0x0004, 0xA800);
  436.  
  437. EXTERN_API( void )
  438. MIDISetConnectionProc            (short                     refNum,
  439.                                  ProcPtr                 connectionProc,
  440.                                  long                     refCon)                                FOURWORDINLINE(0x203C, 0x00A8, 0x0004, 0xA800);
  441.  
  442. EXTERN_API( void )
  443. MIDIGetConnectionProc            (short                     refnum,
  444.                                  ProcPtr *                connectionProc,
  445.                                  long *                    refCon)                                FOURWORDINLINE(0x203C, 0x00AC, 0x0004, 0xA800);
  446.  
  447. EXTERN_API( void )
  448. MIDIDiscardPacket                (short                     refnum,
  449.                                  MIDIPacketPtr             packet)                                FOURWORDINLINE(0x203C, 0x00B0, 0x0004, 0xA800);
  450.  
  451. EXTERN_API( OSErr )
  452. MDVRSignIn                        (OSType                 clientID,
  453.                                  long                     refCon,
  454.                                  Handle                 icon,
  455.                                  Str255                 name)                                FOURWORDINLINE(0x203C, 0x00B4, 0x0004, 0xA800);
  456.  
  457. EXTERN_API( void )
  458. MDVRSignOut                        (OSType                 clientID)                            FOURWORDINLINE(0x203C, 0x00B8, 0x0004, 0xA800);
  459.  
  460. EXTERN_API( MDVRPtr )
  461. MDVROpen                        (short                     portType,
  462.                                  short                     refnum)                                FOURWORDINLINE(0x203C, 0x00BC, 0x0004, 0xA800);
  463.  
  464. EXTERN_API( void )
  465. MDVRClose                        (MDVRPtr                 driverPtr)                            FOURWORDINLINE(0x203C, 0x00C0, 0x0004, 0xA800);
  466.  
  467. EXTERN_API( void )
  468. MDVRControlIn                    (MDVRPtr                 portPtr,
  469.                                  MDVRInCtlPtr             inputCtl)                            FOURWORDINLINE(0x203C, 0x00C4, 0x0004, 0xA800);
  470.  
  471. EXTERN_API( void )
  472. MDVRControlOut                    (MDVRPtr                 portPtr,
  473.                                  MDVROutCtlPtr             outputCtl)                            FOURWORDINLINE(0x203C, 0x00C8, 0x0004, 0xA800);
  474.  
  475. EXTERN_API( void )
  476. MDVRIn                            (MDVRPtr                 portPtr)                            FOURWORDINLINE(0x203C, 0x00CC, 0x0004, 0xA800);
  477.  
  478. EXTERN_API( void )
  479. MDVROut                            (MDVRPtr                 portPtr,
  480.                                  char *                    dataPtr,
  481.                                  short                     length)                                FOURWORDINLINE(0x203C, 0x00D0, 0x0004, 0xA800);
  482.  
  483. EXTERN_API( void )
  484. MDVRNotesOff                    (MDVRPtr                 portPtr,
  485.                                  short                     mode)                                FOURWORDINLINE(0x203C, 0x00D4, 0x0004, 0xA800);
  486.  
  487. enum { uppMIDIReadHookProcInfo = 0x000003E0 };                     /* pascal 2_bytes Func(4_bytes, 4_bytes) */
  488. enum { uppMIDITimeProcInfo = 0x000003C0 };                         /* pascal no_return_value Func(4_bytes, 4_bytes) */
  489. enum { uppMIDIConnectionProcInfo = 0x0009FB80 };                 /* pascal no_return_value Func(2_bytes, 4_bytes, 2_bytes, 4_bytes, 4_bytes, 1_byte, 2_bytes) */
  490. enum { uppMDVRCommProcInfo = 0x00000EB0 };                         /* pascal 4_bytes Func(2_bytes, 2_bytes, 4_bytes) */
  491. enum { uppMDVRTimeCodeProcInfo = 0x00000E80 };                     /* pascal no_return_value Func(2_bytes, 2_bytes, 4_bytes) */
  492. enum { uppMDVRReadProcInfo = 0x00000EC0 };                         /* pascal no_return_value Func(4_bytes, 2_bytes, 4_bytes) */
  493. #define NewMIDIReadHookProc(userRoutine)                         (MIDIReadHookUPP)NewRoutineDescriptor((ProcPtr)(userRoutine), uppMIDIReadHookProcInfo, GetCurrentArchitecture())
  494. #define NewMIDITimeProc(userRoutine)                             (MIDITimeUPP)NewRoutineDescriptor((ProcPtr)(userRoutine), uppMIDITimeProcInfo, GetCurrentArchitecture())
  495. #define NewMIDIConnectionProc(userRoutine)                         (MIDIConnectionUPP)NewRoutineDescriptor((ProcPtr)(userRoutine), uppMIDIConnectionProcInfo, GetCurrentArchitecture())
  496. #define NewMDVRCommProc(userRoutine)                             (MDVRCommUPP)NewRoutineDescriptor((ProcPtr)(userRoutine), uppMDVRCommProcInfo, GetCurrentArchitecture())
  497. #define NewMDVRTimeCodeProc(userRoutine)                         (MDVRTimeCodeUPP)NewRoutineDescriptor((ProcPtr)(userRoutine), uppMDVRTimeCodeProcInfo, GetCurrentArchitecture())
  498. #define NewMDVRReadProc(userRoutine)                             (MDVRReadUPP)NewRoutineDescriptor((ProcPtr)(userRoutine), uppMDVRReadProcInfo, GetCurrentArchitecture())
  499. #define CallMIDIReadHookProc(userRoutine, myPacket, myRefCon)     CALL_TWO_PARAMETER_UPP((userRoutine), uppMIDIReadHookProcInfo, (myPacket), (myRefCon))
  500. #define CallMIDITimeProc(userRoutine, curTime, myRefCon)         CALL_TWO_PARAMETER_UPP((userRoutine), uppMIDITimeProcInfo, (curTime), (myRefCon))
  501. #define CallMIDIConnectionProc(userRoutine, refnum, refcon, portType, clientID, portID, connect, direction)  CALL_SEVEN_PARAMETER_UPP((userRoutine), uppMIDIConnectionProcInfo, (refnum), (refcon), (portType), (clientID), (portID), (connect), (direction))
  502. #define CallMDVRCommProc(userRoutine, refnum, request, refCon)     CALL_THREE_PARAMETER_UPP((userRoutine), uppMDVRCommProcInfo, (refnum), (request), (refCon))
  503. #define CallMDVRTimeCodeProc(userRoutine, refnum, newFormat, refCon)  CALL_THREE_PARAMETER_UPP((userRoutine), uppMDVRTimeCodeProcInfo, (refnum), (newFormat), (refCon))
  504. #define CallMDVRReadProc(userRoutine, midiChars, length, refCon)  CALL_THREE_PARAMETER_UPP((userRoutine), uppMDVRReadProcInfo, (midiChars), (length), (refCon))
  505.  
  506.  
  507. #if PRAGMA_STRUCT_ALIGN
  508.     #pragma options align=reset
  509. #elif PRAGMA_STRUCT_PACKPUSH
  510.     #pragma pack(pop)
  511. #elif PRAGMA_STRUCT_PACK
  512.     #pragma pack()
  513. #endif
  514.  
  515. #ifdef PRAGMA_IMPORT_OFF
  516. #pragma import off
  517. #elif PRAGMA_IMPORT
  518. #pragma import reset
  519. #endif
  520.  
  521. #ifdef __cplusplus
  522. }
  523. #endif
  524.  
  525. #endif /* __MIDI__ */
  526.  
  527.